
import java.util.List;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.ListModelList;
import org.zkoss.zul.ListModels;

/**
 * @author Gabriel
 */
public class MyAutoComplete extends GenericForwardComposer {

  private Combobox combo;

  @Override
  public void doAfterCompose(Component comp) throws Exception {
    super.doAfterCompose(comp);
    combo.setModel(ListModels.toListSubModel(new ListModelList(getAllItems())));
  }

  List getAllItems() {
    ServicioDpto serv = new ServicioDpto();
    return serv.getDptos();
  }
}
